<?php
require('DataMapper.php');
require('RestaurantDO.php');
require('restaurantTDG_model.php');
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of RestaurantMapper
 *
 * @author davidsciacchettano
 */
class RestaurantMapper extends DataMapper{
    public static function findAll() {
        $rList = RestaurantTDG_model::findAll();
        
        return $rList;
    }
    
    public static function findById($id) {
        $r = RestaurantTDG_model::findById($id);
        
        return $r;
    }
    
    public static function insert($r) {
        RestaurantTDG_model::insert($r->getName(), $r->getType(), $r->getAddress1(), 
                $r->getAddress2(), $r->getCity(), $r->getProvince(), $r->getPostalCode(), 
                $r->getCountry(), $r->getPhoneNum());
    }
    
    public static function update($r) {
        RestaurantTDG_model::update($r->getId(), $r->getVersion(), $r->getName(),
                $r->getType(), $r->getAddress1(), $r->getaddress2, $r->getCity(),
                $r->getProvince(), $r->getPostalCode(), $r->getCountry(), $r->getPhoneNum());
    }
    
    public static function delete($r) {
        RestaurantTDG_model::delete($r->getId(), $r->getVersion());
    }
}

?>
